﻿using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Text;

namespace QuanLyDiemSinhVien.Manager
{
    public class ScoreInfo
    {
        private readonly int _scoreId;
        //private int _studentId;
        //private int _semester;
        //private Decimal _courseScore1;
        //private Decimal _courseScore2;
        //private string _violations;
        //private Decimal _subtractScore;
        //private Decimal _courseScoreTotal;
        //private DateTime _createdDate;
        //private DateTime _modifiedDate;
        //private bool _status;

        public ScoreInfo() { }

        public ScoreInfo(DataTable dtb)
        {
            if (dtb != null && dtb.Rows.Count > 0)
            {
                _scoreId = Convert.ToInt32(dtb.Rows[0][0].ToString());
                StudentId = Convert.ToInt32(dtb.Rows[0][1].ToString());
                Semester = Convert.ToInt32(dtb.Rows[0][2].ToString());
                CourseScore1 = Convert.ToDecimal(dtb.Rows[0][3].ToString());
                CourseScore2 = Convert.ToDecimal(dtb.Rows[0][4].ToString());
                Violations = dtb.Rows[0][5].ToString();
                SubtractScore = Convert.ToDecimal(dtb.Rows[0][6].ToString());
                CourseScoreTotal = Convert.ToDecimal(dtb.Rows[0][7].ToString());
                CreatedDate = Convert.ToDateTime(dtb.Rows[0][8].ToString());
                ModifiedDate = Convert.ToDateTime(dtb.Rows[0][9].ToString());
                Status = Convert.ToBoolean(dtb.Rows[0][10].ToString());
            }
        }

        public int ScoreId { get { return _scoreId; } }
        public int StudentId { get; set; }
        public int Semester { get; set; }
        public Decimal CourseScore1 { get; set; }
        public Decimal CourseScore2 { get; set; }
        public string Violations { get; set; }
        public Decimal SubtractScore { get; set; }
        public Decimal CourseScoreTotal { get; set; }
        public DateTime CreatedDate { get; set; }
        public DateTime ModifiedDate { get; set; }
        public bool Status { get; set; }

    }
}
